package com.wang.designpattern.factory.reflectSimplefactory.pizzastore.store;

import com.wang.designpattern.factory.reflectSimplefactory.pizzastore.pizza.LDCheesePizza;
import com.wang.designpattern.factory.reflectSimplefactory.pizzastore.pizza.LDGreekPizza;
import com.wang.designpattern.factory.reflectSimplefactory.pizzastore.pizza.LDPepperPizza;
import com.wang.designpattern.factory.reflectSimplefactory.pizzastore.pizza.Pizza;

/**
 * 伦敦工厂类
 */
public class LDPizzaFactory extends PizzaFactory {

    @Override
    public Pizza createOrder(String orderType) {
        System.out.println("伦敦工厂");
        Pizza pizza = null;
        if (orderType.equals("cheese")) {
            pizza = new LDCheesePizza();
            pizza.setName("伦敦奶酪披萨");
        } else if (orderType.equals("greek")) {
            pizza = new LDGreekPizza();
            pizza.setName("伦敦希腊披萨");
        } else if (orderType.equals("pepper")) {
            pizza = new LDPepperPizza();
            pizza.setName("伦敦胡椒披萨");
        }
        return pizza;
    }
}